package com.linser.gistools.refactoring.javafx.treeitem;

import javafx.scene.Node;
import javafx.scene.control.TreeItem;
import org.opengis.referencing.crs.CoordinateReferenceSystem;

/**
 * @author: linser
 * @Desc: 坐标系 TreeItem
 * @create: 2024-01-26
 */
public class CrsTreeItem extends TreeItem<CoordinateReferenceSystem> {

    private CoordinateReferenceSystem crs;
    private String treeNodeName;

    public CrsTreeItem() {
        super();
    }
    public CrsTreeItem(String treeName) {
        super(null);
        this.treeNodeName = treeName;
    }

    public CrsTreeItem(String treeName,CoordinateReferenceSystem coordinateReferenceSystem) {
        super(coordinateReferenceSystem);
        this.crs = coordinateReferenceSystem;
        this.treeNodeName = treeName;
    }
    public CrsTreeItem(CoordinateReferenceSystem coordinateReferenceSystem) {
        super(coordinateReferenceSystem);
        this.treeNodeName = coordinateReferenceSystem.getName().getCodeSpace();
        this.crs = coordinateReferenceSystem;
    }
    /**
     * Creates a TreeItem with the value property set to the provided object, and
     * the graphic set to the provided Node.
     *
     * @param treeName 节点名称
     * @param coordinateReferenceSystem 节点对象
     * @param graphic The Node to show in the TreeView next to this TreeItem.
     */
    public CrsTreeItem(String treeName,CoordinateReferenceSystem coordinateReferenceSystem, final Node graphic) {
        super(coordinateReferenceSystem,graphic);
        this.crs = coordinateReferenceSystem;
        this.treeNodeName = treeName;
    }


    public CoordinateReferenceSystem getCoordinateReferenceSystem(){
        return this.crs;
    }
    public String getTreeNodeName(){
        return this.treeNodeName;
    }
    public void setTreeNodeName(String treeNodeName){
        this.treeNodeName = treeNodeName;
    }
}
